;; ----------------------------------------------------------------
;; いろいろ読み込み

;(load "/u/mc/cl/slime/swank")

;; If you want customize the source- or fasl-directory you can set
;; swank-loader:*source-directory* resp. swank-loader:*fasl-directory*
;; before loading this files. (you also need to create the
;; swank-loader package.)
;; E.g.:
;;
;;   (make-package :swank-loader)
;;   (defparameter swank-loader::*fasl-directory* "/tmp/fasl/")
;;   (load ".../swank-loader.lisp")

#|(or (find-package :swank)
    (load "/u/mc/cl/slime/swank-loader.lisp"))|#

(in-package :mkcore)

(say :asdf)

#+sbcl
(progn
;  (asdf-install:install :mcclim)
;  (asdf-install:install :climacs)
  (load-systems
   '(:cl-glfw))

)

;#+(or allegro clisp)
;(load-systems '(:starlisp))

;; all
(load-systems
 '(
   :pregexp
   :flexi-streams
   #-noswank :swank
   :kmrcl 
   :url-rewrite
   :cl-ppcre
   :screamer
   :iterate
   :lw-compat
   :rt
   :alexandria
   :mbe
   :bpm
   :lml2
   :fare-matcher
   #-allegro :cl-unicode
   #+(and sbcl x86-64 (not :sb-thread)) :stumpwm
   :vecto
   :cl-cont
   ))



#-abcl
(load-systems
 '(
   #-(or ccl clisp) :drakma   
   #-ecl :metatilities
   #-(or ecl ccl) :series
   :portable-threads
   ))



#+sbcl 
(load-systems 
 '(
;   :cl-muproc
   :arnesi
   :aspectl
   :bordeaux-threads
   :babel
   :date-calc
   :yt-debug
   ))


; CCL
;Read error between positions 1025 and 1598 in /share/sys/cl/src/usocket-0.3.5/backend/openmcl.lisp.
;> Error: Reader error on #<BASIC-FILE-CHARACTER-INPUT-STREAM ("/share/sys/cl/src/usocket-0.3.5/backend/openmcl.lisp"/6 UTF-8) #x3000413ACDFD>, near position 1598, within "lls::selec":
;>        Reference to unknown package "SYSCALLS".
;> While executing: CCL::SIGNAL-READER-ERROR, in process listener(1).
;> Type :GO to continue, :POP to abort, :R for a list of available restarts.
;> If continued: Skip loading "/u/mc/prog-ubuntu/cl/make-core"
;> Type :? for other options.

; CCL
;> Error: No MAKE-LOAD-FORM method is defined for #<CCL::SIMPLE-PROGRAM-ERROR #x30004169356D>> While executing: CCL::NO-MAKE-LOAD-FORM-FOR, in process listener(1).> Type :GO to continue, :POP to abort, :R for a list of available restarts.> If continued: Skip loading "/u/mc/prog-ubuntu/cl/make-core"> Type :? for other options.

#-(or allegro ecl)
(load-systems
 '(
   #-(or abcl clisp lispworks) :osicat
   :puri
   #-abcl :acl-compat
   #-abcl :pxmlutils
   ))  

;  
;  #+(and openmcl darwin) (require :hemlock)
;  ;; lml
;  ;; cl-darcs
;  ;(asdf:oos 'asdf:load-op :cl-fad)
;  ;(asdf:oos 'asdf:load-op :cl-difflib)
;  ;(asdf:oos 'asdf:load-op :flexi-streams)
;  ;(asdf:oos 'asdf:load-op :TRIVIAL-GRAY-STREAMS)
;  ;(asdf:oos 'asdf:load-op :IRONCLAD)
;  ;(asdf:oos 'asdf:load-op :cl-darcs)
;  ;(asdf:oos 'asdf:load-op :cl+ssl)
;  
(say "よーし、パパ、ライブラリとかいろいろ取り込んじゃうぞ!")

;  #-abcl (progn

(progn
  (say :srfi)
  (mapc (lambda (f) (clisp-load f ))
        '("lib:setagaya;srfi;package.lisp"
          "lib:setagaya;srfi;srfi-1.lisp"
          "lib:setagaya;srfi;srfi-26.lisp"
          "lib:setagaya;srfi;srfi-61.lisp"
          "lib:setagaya;srfi;srfi-87.lisp")))

(progn
  ;; maclisp
  (say :Maclisp-compat)
  (clisp-load "lib:setagaya;maclisp-compat;package.lisp"))

(progn
  ;; onlisp
  (say :onlisp)
  (mapc (lambda (x) (clisp-load x))
        '(
          "lib:onlisp;package.lisp"
          "lib:onlisp;onlisp-util.lisp"
          "lib:onlisp;onlisp-app.lisp")
        )
                                        ;(load "lib:onlisp;utx") 
  )

#-ccl
(progn
  ;; twitter
  #-(or ecl clisp) (clisp-load "lib:setagaya;twitter.lisp")
  )


(progn
  ;; tao
  (load-systems '(:tao-compat))
  )

(progn
  ;; xyzzy
  (load-systems '(:xyzzy-compat))
  )


(progn
  ;; arc
  #-clisp (load-systems '(:arc-compat))
  )

'(progn
  ;; utils
  (say :utils)
  (load "lib:local;utils")
  )

#-(or clisp ccl)
(progn
  ;; home
  (say :home)
  (load "/u/mc/lisp/Work/home"))

#-(or clisp ccl)
(progn
  ;; はてダラ
  (say :hw)
  (load "/u/mc/lisp/Work/hw"))

(format t "パッケージ一覧だぞ~%~{~A~%~^~}~&~A~%" 
        (sort (mapcar #'package-name (list-all-packages)) #'string-lessp)
        "--------------------------------------------------------------------------------")
